import { Bridge } from 'js-bridge-adapter'
import bridgeOptionsFn from '../defaultOptions'
const bridge = new Bridge('android')

bridge.config({
  support: () => true,
  api:
    <T = any>(key: T) =>
    (...args: any[]) =>
      window.InstallmentJsObj[key](...args)
})

bridge.register((api: Function) => ({
  ...bridgeOptionsFn(api)
}))
export default bridge
